package com.jrx.anytxn.reporting.job.xib.step;

import com.jrx.anytxn.reporting.entity.CmInteCoLonInfo;
import com.jrx.anytxn.reporting.entity.CmInteCoLonInfoBean;
import com.jrx.anytxn.reporting.service.IXibService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.batch.item.ItemProcessor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @description: 生成贷款信息 数据处理入口  (兴安借)
 * @author: shigongtai
 * @date: 2023/4/13 14:29
 */
@Service
public class LonInfoXajProcessor implements ItemProcessor<CmInteCoLonInfo, CmInteCoLonInfoBean> {

    @Autowired
    private IXibService xibService;

    private static final Logger logger = LoggerFactory.getLogger(LonInfoXajProcessor.class);

    @Override
    public CmInteCoLonInfoBean process(CmInteCoLonInfo item) throws Exception {
        try {
            return xibService.assemLoanInfoXaj(item);
        } catch (Exception e) {
            e.printStackTrace();
            logger.error("LonInfoXajProcessor出错了：{}", e.getMessage());
        }
        return null;
    }
}
